import Vue from 'vue';
import VueRouter from 'vue-router';

// 1注册路由
Vue.use(VueRouter);

// 2创建路由规则
let routes = [
  {
    path: '/',
    redirect: '/login', //重定向
  },
  {
    path: '/login',
    component: () => import('@/views/login'),
  },
];

//3创建路由对象
let router = new VueRouter({
  routes,
});

/** 4路由配置  */
export default router;
